class Request {
	constructor() {
	  this.base_url = 'http://123.207.32.32:9001'
	}
	
	request(url, method, params) {
		return new Promise((resolve, reject) =>{
			uni.request({
				url: this.base_url + url,
				method: method,
				data: params,
				success: resolve,
				fail: reject
			})
		})
	}
	
	get(url, params) {
		return this.request(url, "GET", params)
	}
	
	post(url, params) {
		return this.request(url, "POST", params)
	}
}

export default new Request()